<?php
defined('SYSPATH') or die('No direct script access');
/*
 * Created on Nov 6, 2009
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
class Mapper_Controller extends Website_Controller {
	
	public function index() {

		// Create the map
		$map = new Gmap('map', array (
			'ScrollWheelZoom' => TRUE
		));

		// Set the map center
		$map->center(35.913679, -79.055927, 13)->controls('large')->types('G_PHYSICAL_MAP', 'add');

		// Add a customized
		$map->add_icon('tinyIcon', array (
			'image' => 'http://labs.google.com/ridefinder/images/mm_20_red.png',
			'shadow' => 'http://labs.google.com/ridefinder/images/mm_20_shadow.png',
			'iconSize' => array ('12','20'),
			'shadowSize' => array ('22','20'),
			'iconAnchor' => array ('6','20'),
			'infoWindowAnchor' => array ('5','1')
		));
		
		// Add a marker
		$map->add_marker(35.913679, -79.055927, '<strong>Chapel Hill, NC</strong><p>2009 Natl Champs</p>', array (
			'icon' => 'tinyIcon'
		));
		
		$this->template->head = new View('pages/mapHead');
		$this->template->content = new View('pages/mapContent');
		
		$this->template->head->api_url = Gmap::api_url();
		$this->template->head->map = $map->render();
		$this->template->title = 'My Map::OMWPT';
		
	}
}
?>
